<template>
  <div>
    <div class="base-info">
      <h2 class="detail-title">班级基本信息</h2>
      <div class="detail-info">
        <div class="detail-item">班级ID：{{data.class_id}}</div>
        <div class="detail-item">班级名称：{{data.class_name}}</div>
        <div class="detail-item">年级：{{data.grade}}</div>
        <div class="detail-item">学校名称：{{data.school_name}}</div>
        <div class="detail-item">学院名称：{{data.college_name}}</div>
        <div class="detail-item">专业名称：{{data.major_name}}</div>
        <div class="detail-item">班级状态：{{data.statusLabel}}</div>
      </div>
    </div>
    <div class="class-info">
      <ClassStudents :class_id="id" />  
    </div>
    <el-button class="go-back-btn" @click="goBack" type="primary">返回</el-button>
  </div>
</template>
<script>
import goBack from "@/mixins/goBack";
import { classModel } from "@/api/admin_models";
import ClassStudents from '@/components/ClassStudents'
export default {
  mixins: [goBack],
  components: {ClassStudents},
  data() {
    return {
      data: {},
      id: null
    };
  },
  mounted() {
    this.id = this.$route.params.id;
    this.getItem();
  },
  methods: {
    getItem() {
      classModel.item(this.id, res => {
        this.data = res.data;
      });
    }
  }
};
</script>
<style scoped lang="scss">

</style>